﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WcfServiceLibraryDao
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together.
    public class ServiceDaoDelete : IServiceDaoDelete
    {

        public void DeleteClass(int classId)
        {
            SchoolDataContext context = new SchoolDataContext();
            Class classToDelete = (from classes in context.Classes
                                   where classes.ClassID == classId
                                   select classes).SingleOrDefault();
            context.Classes.DeleteOnSubmit(classToDelete);
            context.SubmitChanges();
        }

        public void DeleteStudent(int studentId)
        {
            throw new NotImplementedException();
        }
    }
}
